package top.mcwebsite.lib.router.processor

import com.squareup.kotlinpoet.TypeName
import top.mcwebsite.lib.router.annotation.ParamType

data class RouteMeta(
    val routePath: String,
    val alternate: List<String>,
    val params: List<ParamMeta>,
    val functionName: String,
)

data class ParamMeta(
    val name: String,
    /**
     * 函数参数名称
     */
    val funParamName: String,
    val type: ParamType,
    val nullable: Boolean,
    val typeName: TypeName,
)

val ParamType.isPrimitiveType: Boolean
    get() = this == ParamType.BYTE ||
            this == ParamType.SHORT ||
            this == ParamType.INT ||
            this == ParamType.LONG ||
            this == ParamType.FLOAT ||
            this == ParamType.DOUBLE ||
            this == ParamType.BOOLEAN ||
            this == ParamType.CHAR